<script>
	/*
		let apples = {count: 10, price: 2}
		let oranges = {count:3, price: 1.5}
		console.log(`我买了${apples.count
		}个苹和${oranges.count
		}个橙子，一共花了${
				apples .count * apples.price + oranges.count * oranges.price
		}块钱`)



function  intr (p) {
		return `我是${p.name},来自${p.home}`
}
console.log(intr({name:'张三',home:"火星"}))


		let items = [
				{name:'兔子',color:'白色'},
				{name:'小狗',color:'黑色'},
				{name:'牛',color:'红色'}
		]
		console.log(`
		<p>我家养了这些动物：</p>
		<ul>${
				items.map(function(item) {
						return `<li>${item.color}的${item.name}</li>`
				}).join('')
		}</ul>
		<p>一共多少条腿:${items.reduce(function(s,item){
					return s+item.foot*item.count
				},0)
				}</p >

				`)*/
	const data = [
		[1, 2, 3],
		[4, 5, 6],
		[7, 8, 9],
	]
	const table = `<table border="1">
				${data.map(function (data) {
		return `<tr>${data.map(function (data) {
			return `<td>${data}</td>`
		}).join("")}</tr>`
	}).join("")}
				</table>`
	document.write(table)		
</script>